// 1. 定义管理员  src\store\reducer\index.js
const defaultState = {
    num: 1,
    userInfo: {
        name: '小明',
        avator: 'xxx.png'
    }
};

const reducer = (state = defaultState, action) => {
    if (action.type === 'add') {
        let newState = JSON.parse(JSON.stringify(state));
        newState.num += action.value;
        return newState;
    }
    return state;
};

export default reducer;